package com.travel.photos.ui.find;

import com.travel.photos.bean.FindBean;
import com.travel.photos.bean.RecommendBean;
import com.travel.photos.http.HttpHelper;

import java.util.Map;

import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by Administrator on 2016/10/17.
 */
public class FindModel implements FindContract.Model {

    @Override
    public void getDetail( Map<String, String> findmap,
                           Map<String,String> remap,
                          Subscriber<FindBean> findsubscriber,
                          Subscriber<RecommendBean> resubscriber) {
        HttpHelper.getInstance().getFindData(findmap)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(findsubscriber);
        HttpHelper.getInstance().getReData(remap)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(resubscriber);

    }
}
